package com.muyu.vehicle.service.impl;

import java.util.List;

import com.vehicle.common.core.utils.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.muyu.vehicle.mapper.VehicleFaultLogMapper;
import com.muyu.vehicle.domain.VehicleFaultLog;
import com.muyu.vehicle.service.IVehicleFaultLogService;

/**
 * 车辆故障报警记录Service业务层处理
 *
 * @author muyu
 * @date 2021-09-04
 */
@Service
public class VehicleFaultLogServiceImpl implements IVehicleFaultLogService
{
    @Autowired
    private VehicleFaultLogMapper vehicleFaultLogMapper;

    /**
     * 查询车辆故障报警记录
     *
     * @param id 车辆故障报警记录主键
     * @return 车辆故障报警记录
     */
    @Override
    public VehicleFaultLog selectVehicleFaultLogById(String id)
    {
        return vehicleFaultLogMapper.selectVehicleFaultLogById(id);
    }

    /**
     * 查询车辆故障报警记录列表
     *
     * @param vehicleFaultLog 车辆故障报警记录
     * @return 车辆故障报警记录
     */
    @Override
    public List<VehicleFaultLog> selectVehicleFaultLogList(VehicleFaultLog vehicleFaultLog)
    {
        return vehicleFaultLogMapper.selectVehicleFaultLogList(vehicleFaultLog);
    }

    /**
     * 新增车辆故障报警记录
     *
     * @param vehicleFaultLog 车辆故障报警记录
     * @return 结果
     */
    @Override
    public int insertVehicleFaultLog(VehicleFaultLog vehicleFaultLog)
    {
        return vehicleFaultLogMapper.insertVehicleFaultLog(vehicleFaultLog);
    }

    /**
     * 修改车辆故障报警记录
     *
     * @param vehicleFaultLog 车辆故障报警记录
     * @return 结果
     */
    @Override
    public int updateVehicleFaultLog(VehicleFaultLog vehicleFaultLog)
    {
        return vehicleFaultLogMapper.updateVehicleFaultLog(vehicleFaultLog);
    }

    /**
     * 批量删除车辆故障报警记录
     *
     * @param ids 需要删除的车辆故障报警记录主键
     * @return 结果
     */
    @Override
    public int deleteVehicleFaultLogByIds(String[] ids)
    {
        return vehicleFaultLogMapper.deleteVehicleFaultLogByIds(ids);
    }

    /**
     * 删除车辆故障报警记录信息
     *
     * @param id 车辆故障报警记录主键
     * @return 结果
     */
    @Override
    public int deleteVehicleFaultLogById(String id)
    {
        return vehicleFaultLogMapper.deleteVehicleFaultLogById(id);
    }

    @Override
    public void insertVehicleFaultLog(String vin, String label) {
        vehicleFaultLogMapper.insertVehFaultLog(IdUtils.fastSimpleUUID(),vin,label);
    }
}
